<extend name="work/base"/>
<block name="content">

    <div class="layui-tab layui-tab-brief" lay-filter="projecttab">
        <ul class="layui-tab-title">
            <li class="layui-this" lay-id="11">概况</li>
            <volist name="project_model" id="vo" key="k">
                <li lay-id="{$k}">{$vo}</li>
            </volist>
            <li lay-id="12">项目文档</li>
            <eq name="project_user" value="1">
                <li lay-id="14">项目财务</li>
            </eq>
            <li lay-id="13">项目日志</li>
        </ul>
    </div>
    <div id="tabc" style="height: 100%">
</block>

<block name="script">
    <link rel="stylesheet" href="https://cdn.weibuyun.com/static/admin/plugins/formSelects-v4.css">
    <script charset="utf-8" src="https://cdn.weibuyun.com/static/admin/plugins/wangeditor/wangEditor.min.js"></script>
    <script charset="utf-8" src="https://unpkg.com/qiniu-js@2.5.4/dist/qiniu.min.js"></script>
    <script src="https://cdn.weibuyun.com/static/admin/js/echarts.min.js"></script>
    <script type="text/javascript">
        layui.use(['element', 'table', 'form'], function () {
            var table = layui.table
                , element = layui.element
                $=layui.$
                , form = layui.form;
            var url = "{:url('project/projectadmin/board?project_id='.$project_id)}";
            gethtml(url, 1)
            element.on('tab(projecttab)', function () {

                switch (Number(this.getAttribute('lay-id'))) {
                    case 1:
                    case 2:
                    case 3:
                        var url = "{:url('project/stories/index?project_id='.$project_id)}";
                        param = this.getAttribute('lay-id');
                        break;
                    case 12:
                        var url = "{:url('project/docadmin/index?project_id='.$project_id)}";
                        param = 1;
                        break;
                    case 11:
                        var url = "{:url('project/projectadmin/board?project_id='.$project_id)}";
                        param = 1;
                        break;
                    case 13:
                        var url = "{:url('project/projectlog/index?project_id='.$project_id)}";
                        param = 1;
                        break;
                    case 14:
                        var url = "{:url('project/financial/index?project_id='.$project_id)}";
                        param = 1;
                        break;
                    default:
                        var url = "{:url('project/projectadmin/board?project_id='.$project_id)}";
                        param = 1;

                }
              //  console.log(this.getAttribute('lay-id'))
                gethtml(url, param)

            });

            function gethtml(url, model_id) {
                var loading = layer.load(2);
                $("#tabc").html('');
                param = 'model_id=' + model_id;
                $.get(url, param, function (html) {
                    if (typeof html === 'object') {
                        layer.msg(html.msg);
                        return false;
                    }
                    $("#tabc").html(html);
                });
                layer.close(loading);
            }
        });
    </script>
</block>
